import java.util.Random;


public class TTTDumbPlayer implements TTTPlayer
{
	
	public TTTDumbPlayer()
	{
		// You can implement this constructor, but it may not be necessary.
		//throw new RuntimeException("You must implement this method!");
	}
	
	public TTTMove getMove(TTTBoard board, int player)
	{
		// DumbPlayer will only pick a random position
		Random rd = new Random(System.currentTimeMillis());
		int row,col;
		while(true){
			// random [0,rows/cols)
			row = rd.nextInt(board.getRows());
			col = rd.nextInt(board.getCols());
			
			//
			if (board.getBoardData(row, col) == board.EMPTY)
				break;
		}
		
		return new TTTMove(row,col,player);
		//throw new RuntimeException("You must implement this method!");
	}
	
}
	

